@extends('backstage.layout.master')
@section('title', '角色列表')
@section('style')
    <style>
        a{
            cursor: pointer;
        }
    </style>
@stop
@section('content')
    <div class="breadcrumbs" id="breadcrumbs">
        <script type="text/javascript">
            try {
                ace.settings.check('breadcrumbs', 'fixed')
            } catch (e) {
            }
        </script>

        <ul class="breadcrumb">
            <li>
                <i class="icon-home home-icon"></i>
                <a href="backstage/home">主页</a>
            </li>

            <li class="active">
                角色列表
            </li>
        </ul><!-- .breadcrumb -->
    </div>

    <div class="page-content">
        <div class="page-header">
            <h1>
                角色列表
            </h1>
        </div>
        <div class="row">
            <div class="col-xs-12">
                <a href="backstage/roles/add">
                    <button class="btn btn-danger add-btn-danger" style="float: right;">新增角色</button>
                </a>
            </div>
            <div class="col-xs-12">
                <!-- PAGE CONTENT BEGINS -->
                <div class="table-responsive">
                    <table id="sample-table-1" class="table table-striped table-bordered table-hover">
                        <thead>
                        <tr>
                            <th>编号</th>
                            <th>角色</th>
                            <th>权限管理</th>
                            <th>描述</th>
                            <th>操作</th>
                        </tr>
                        </thead>

                        <tbody>
                        @foreach ($roles as $role)
                        <tr>
                            <td>{{$role->id}}</td>
                            <td>
                                {{$role->display_name}}
                            </td>
                            <td>
                                <a href="backstage/roles/add-permission/{{$role->id}}">
                                    <button class="btn btn-minier btn-yellow">权限分配</button>
                                </a>
                            </td>
                            <td>{{$role->description}}</td>
                            <td>
                                <a class="blue" href="backstage/roles/update/{{$role->id}}">编辑</a>
                                <a class="red" href="backstage/roles/delete/{{$role->id}}" onclick="return confirm('确认删除吗？');">删除</a>
                            </td>
                        </tr>
                        @endforeach
                        </tbody>
                    </table>
                </div>
                <div class="row">
                    <div class="col-sm-6">
                        <div class="dataTables_info" id="sample-table-2_info"></div>
                    </div>
                    <div class="col-sm-6">
                        <div class="dataTables_paginate paging_bootstrap">
                            <?php echo $roles->render(); ?>
                        </div>
                    </div>
                </div>
                            <!-- PAGE CONTENT ENDS -->
            </div><!-- /.col -->
        </div><!-- /.row -->
    </div><!-- /.page-content -->
@stop
@section('script')

@stop